<?php

/*
	Class: CommerceMagentoOrders

	About: Author
		Rich Joslin

	About: License
		<http://communit.as/docs/license>
*/
class CommerceMagentoOrders extends Commerce_Db_Model_Magento {

	/* Group: Instance Methods */

	/*
		Function: getAllOrders
	*/
	function getAllOrders($filters = null) {
		$this->initSoap();
		return $this->client->call(
			$this->_api_session_id,
			'order.list',
			$filters
		);
	}

	/*
		Function: getOrders
	*/
	function getOrders($customer_id) {
		$this->initSoap();
		return $this->client->call(
			$this->_api_session_id,
			'order.list',
			array($customer_id)
		);
	}

	/*
		Function: getOrderInfo
	*/
	function getOrderInfo($order_id) {
		$this->initSoap();
		return $this->client->call(
			$this->_api_session_id,
			'order.info',
			array($order_id)
		);
	}

	/*
		Function: getShipments
	*/
	function getShipments($order_id) {
		$this->initSoap();
		return $this->client->call(
			$this->_api_session_id,
			'order_shipment.list',
			array(array('order_increment_id' => $order_id))
		);
	}

	/*
		Function: getShipmentInfo
	*/
	function getShipmentInfo($shipment_id) {
		$this->initSoap();
		return $this->client->call(
			$this->_api_session_id,
			'order_shipment.info',
			array($shipment_id)
		);
	}

}
